package org.msss.gamebasic;

import org.lwjgl.util.Rectangle;

/**
 * Things like the player and enemies will extend sprite.
 * 
 * @author alanxoc3
 * 
 */
public abstract class Sprite extends Icon {

	private boolean visible, solid;
	private Rectangle bounds;
	private int direction;
	private double flipx, flipy;
	
	public Sprite() {
		visible = true;
		solid = true;
		direction = 0;
		flipx = 0;
		flipy = 0;
		bounds = new Rectangle();
		
		create();
	}

	/**
	 * What happens when your object is created.
	 */
	public void create() {
		
	}
	
	/**
	 * What happens when a key is pressed.
	 * @param keyPressed
	 */
	public void pressed(int keyPressed) {
		
	}
	
	/**
	 * What happens when a key is down.
	 * @param keyDown
	 */
	public void down(int keyDown) {
		
	}
	
	/**
	 * What happens when a key is released.
	 * @param keyReleased
	 */
	public void released(int keyReleased) {
		
	}
	
	/**
	 * Will be called in the game loop, contain's the code for moving the
	 * sprite.
	 */
	public void move() {

	}

	/**
	 * Will be called in the game loop, contain's the code for collisions with
	 * the sprite.
	 */
	public void collision() {

	}
	
	/**
	 * You can use this method to draw images and shapes to the room or view.
	 */
	public void draw() {
		
	}

	//Getters and setters...
	
	public boolean isVisible() {
		return visible;
	}

	public void setVisible(boolean visible) {
		this.visible = visible;
	}

	public boolean isSolid() {
		return solid;
	}

	public void setSolid(boolean solid) {
		this.solid = solid;
	}

	public Rectangle getBounds() {
		return bounds;
	}

	public void setBounds(Rectangle bounds) {
		this.bounds = bounds;
	}
	
	public int getW() {
		return bounds.getWidth();
	}
	
	public void setW(int w) {
		bounds.setWidth(w);
	}
	
	public int getH() {
		return bounds.getHeight();
	}
	
	public void setH(int h) {
		bounds.setHeight(h);
	}
	
	public int getDirection() {
		return direction;
	}
	
	public void setDirection(int direction) {
		this.direction = direction;
	}

	public double getFlipx() {
		return flipx;
	}

	public void setFlipx(double flipx) {
		this.flipx = flipx;
	}

	public double getFlipy() {
		return flipy;
	}

	public void setFlipy(double flipy) {
		this.flipy = flipy;
	}
}
